package com.weareint.biz.converter;

import com.weareint.biz.entity.ProductBom;
import com.weareint.biz.vo.ProductBomVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;


/**
 *
 *
 * <pre>
 *      ProductBomConverter
 * </pre>
 *
 * @author Johnny
 * @date 2021-09-28
 */
@Mapper
public interface ProductBomConverter {

   ProductBomConverter INSTANCE = Mappers.getMapper(ProductBomConverter.class);


    /**
     * 实体 转 vo
     * @param entity : ProductBom
     * @return : ProductBomVo
     */
    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
     ProductBomVo domain2vo(ProductBom entity);

    /**
     * vo 转 实体
     * @param vo : ProductBomVo
     * @return : ProductBom
     */
    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    ProductBom vo2domain(ProductBomVo vo);
}
